package com.wanxi.fileandio.io;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Readr {
    public static void main(String[] args) {
        FileReader fileReader = null;
        try {
            File file = new File("reader.txt");
            fileReader = new FileReader(file);
//            BufferedReader bufferedReader = new BufferedReader(fileReader);
//
//            bufferedReader.readLine()
            char[] cBuffer = new char[100];
            int len;
            while ((len = fileReader.read(cBuffer)) != -1) {
                for (int i = 0; i < len; i++) {
                System.out.print(cBuffer[i]);
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if(fileReader!=null)
                fileReader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }


    }
}
